<template>
  <div class="courseware">
    <a-table
      :columns="columns"
      ref="table"
      :data-source="courseList"
      :pagination="false"
      :scroll="{ y: height }"
    >
    </a-table>
  </div>
</template>

<script>
export default {
  props: {
    courseList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data () {
    return {
      columns: [
        {
          title: '课程ID',
          dataIndex: 'courseWareId',
          align: 'center'
        },
        {
          title: '课程名称',
          dataIndex: 'courseWareName',
          align: 'center'
        },
        {
          title: '教师姓名',
          dataIndex: 'teacherName',
          align: 'center'
        },
        {
          title: '年份',
          dataIndex: 'year',
          align: 'center'
        },
        {
          title: '课件状态',
          dataIndex: 'activeStatus',
          align: 'center'
        }
      ],
      height: 0
    }
  },
  watch: {
  },
  mounted () {
    this.height = window.innerHeight - 200
    this.getHeight()
  },
  methods: {
    getHeight () {
      window.onresize = () => {
        this.height = window.innerHeight - 200
      }
    }
  }
}
</script>

<style lang="less" scoped>
</style>
